# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=perl-dbd-sqlite
pkgver=1.54
pkgrel=4
pkgdesc="Self-contained RDBMS in a DBI driver"
arch=('i686' 'x86_64')
url="http://search.cpan.org/dist/DBD-SQLite"
license=('GPL' 'PerlArtistic')
depends=('perl-dbi' 'sqlite')
source=(http://www.cpan.org/authors/id/I/IS/ISHIGAKI/DBD-SQLite-${pkgver}.tar.gz)
md5sums=('8f835ddacb9a4a92a52bbe2d24d18a8e')

build() {
  cd DBD-SQLite-${pkgver}
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd DBD-SQLite-${pkgver}
  make test
}

package() {
  cd DBD-SQLite-${pkgver}
  make install DESTDIR="${pkgdir}"

# template start; name=perl-binary-module-dependency; version=1;
if [[ $(find "$pkgdir/usr/lib/perl5/" -name "*.so") ]]; then
	_perlver_min=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]);')
	_perlver_max=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]+1);')
	depends+=("perl>=$_perlver_min" "perl<$_perlver_max")
fi
# template end;
}
